import { createBrowserRouter, createHashRouter } from "react-router-dom";
import Login from "../page/login";
import Article from "../page/article";
import Layout from "../page/Layout";
import Board from "../page/Board";
import About from "../page/About";
import NotFund from "../page/NotFund";

const router = createBrowserRouter([
    {
        path: '/',
        element: <Layout />,
        children: [
            //设置为默认二级路由
            {
                index: true,
                //path: 'board',
                element: <Board />
            },
            {
                path: 'about',
                element: <About />
            }
        ]
    },
    {
        path: '/login',
        element: <Login />
    },
    {
        path: '/article/:id/:name',
        element: <Article />
    },
    {
        //404路由配置
        path: '*',
        element: <NotFund/>
    }
])

export default router